home *** CD-ROM | disk | FTP | other *** search
- global gSayWhat, gPictureState, gWhichSprite, gWhichOpening, gFudgeFactor, gAutoInterval, gAutoDelay, gDemoState, gTimeKeeper, gGameList, gViewedList, gRollOverList, gRhythmTime, gRocketTime, gPatternTime, gHiddenTime, gBowlingTime, gSkylightTime, gSticklerTime, gTimerList, gPicNumList, gPicList, gColorDepth, gSkipIntro, gCurrentSound, CloseAudioList, gFinalExit, gVolume, gCorpDemo, gPickerPath, gCorpDemoList, gReturnFrame
-
- on TalkPolly
- puppetSound(gSayWhat)
- end
-
- on CheckTheTimer
- if gCorpDemo = "Picker DemoAll" then
- set gDemoState to 1
- end if
- if (gDemoState = 1) or (the timer > gAutoDelay) then
- startTheDemo()
- end if
- end
-
- on CheckTheBowlingTimer
- if the timer > gAutoDelay then
- set gDemoState to 1
- go("Leave")
- end if
- end
-
- on initGlobals
- set the volume of sound 1 to 255
- set the volume of sound 2 to 255
- set gAutoInterval to 5 * 60
- set gAutoDelay to 3 * 60 * 60
- SpriteVisibility(1, 48, 1)
- set gDemoState to 0
- set gGameList to ["HiddenPic", "PuzzlPatt", "SuperStick", "Rhythm", "Rockets", "Bowling", "Skylight"]
- set gViewedList to []
- set gPictureState to 0
- set RhythmCH to 21
- set RocketCH to 23
- set PatternCH to 31
- set HiddenPicCH to 33
- set SuperSticklerCH to 29
- set BowlingCH to 25
- set SkylightCH to 27
- set LeftCloudCH to 35
- set RightCloudCH to 37
- set RhythmTime to 0
- set RocketTime to 0
- set PatternTime to 0
- set HiddenPicTime to 0
- set SuperSticklertime to 0
- set BowlingTime to 0
- set SkyLightTime to 0
- set LeftCloudTime to 0
- set RightCloudTime to 0
- set gRollOverList to [RhythmCH, RocketCH, PatternCH, HiddenPicCH, SuperSticklerCH, BowlingCH, SkylightCH, LeftCloudCH, RightCloudCH]
- set gTimerList to [RhythmTime, RocketTime, PatternTime, HiddenPicTime, SuperSticklertime, BowlingTime, SkyLightTime, LeftCloudTime, RightCloudTime]
- resetDemo()
- set gFinalExit to EMPTY
- end
-
- on KillTheGlobals
- if voidp(gCorpDemo) then
- clearGlobals()
- end if
- end
-
- on testrollover
- repeat with x = 1 to 9
- set nextSprite to getAt(gRollOverList, x)
- set whichTime to getAt(gTimerList, x)
- if rollOver(nextSprite + 1) then
- set the visible of sprite nextSprite to 1
- set whichTime to the ticks
- deleteAt(gTimerList, x)
- addAt(gTimerList, x, whichTime)
- end if
- end repeat
- end
-
- on checkTimes
- repeat with x = 1 to 9
- set origTime to getAt(gTimerList, x)
- set currentSprite to getAt(gRollOverList, x)
- if the ticks > (origTime + 480) then
- set the visible of sprite currentSprite to 0
- end if
- end repeat
- end
-
- on startMovie
- checkMonitor("start")
- set gVolume to the soundLevel
- if the soundLevel = 0 then
- set the soundLevel to 1
- end if
- initGlobals()
- set the exitLock to 1
- set the volume of sound 1 to 255
- set the volume of sound 2 to 255
- SetUpBowlingInits()
- end
-
- on keyDown
- checkExit()
- end
-
- on checkExit
- set QuitMe to 0
- if the keyCode = 53 then
- set QuitMe to 1
- end if
- if the commandDown and ((the key = ".") or (the key = "q")) then
- set QuitMe to 1
- end if
- if QuitMe = 1 then
- if gFinalExit <> "LastRoundUp" then
- setupPuppets(1, 48, 0)
- mouseLock(1)
- set gFinalExit to "LastRoundUp"
- if gCorpDemo = "Picker DemoAll" then
- exitAutoRun()
- else
- go("quit")
- end if
- end if
- end if
- end
-
- on stopMovie
- resetBowlingInits()
- if voidp(gCorpDemo) then
- checkMonitor("stop")
- end if
- KillTheGlobals()
- sound fadeOut 1, 2 * 60
- sound fadeOut 2, 2 * 60
- end
-
- on checkMonitor whichState
- if whichState = "start" then
- if the colorDepth <> 8 then
- if the machineType = 256 then
- set Msg to the text of cast "Monitor Alert Message"
- alert(Msg)
- quit()
- else
- set gColorDepth to the colorDepth
- set the colorDepth to 8
- end if
- end if
- else
- if the machineType <> 256 then
- if gColorDepth <> EMPTY then
- set the colorDepth to gColorDepth
- end if
- end if
- end if
- end
-
- on resetDemo
- set HowManyPics to 7
- set gPicNumList to []
- set gPicList to ["PuzzlePattern", "Rockets", "HiddenPictures", "SuperStickler", "Rhythm", "Bowling", "SkyLight"]
- set totalPick to 0
- set gDemoState to 0
- repeat while totalPick < HowManyPics
- set newNumber to random(HowManyPics)
- if getOne(gPicNumList, newNumber) = 0 then
- add(gPicNumList, newNumber)
- set totalPick to totalPick + 1
- end if
- end repeat
- end
-
- on exitAutoRun
- puppetSprite(48, 0)
- setupPuppets(1, 48, 0)
- mouseLock(1)
- if gCorpDemo = "Picker DemoAll" then
- set gCorpDemo to "Picker DemoNone"
- go("logo", gPickerPath)
- dontPassEvent()
- else
- sound close 1
- sound close 2
- initGlobals()
- puppetSound(0)
- dontPassEvent()
- go("Begin")
- end if
- end
-
- on startTheDemo
- if gCorpDemo = "Picker DemoNone" then
- set gCorpDemo to "Picker DemoAll"
- go("returnFade", gPickerPath)
- exit
- end if
- set gDemoState to 1
- mouseLock(0)
- set the mouseDownScript to "exitAutoRun"
- setupPuppets(1, 48, 0)
- if the timer > gAutoInterval then
- if gPicNumList = [] then
- go("WhistleUp")
- exit
- end if
- set nextRanNum to getAt(gPicNumList, 1)
- set nextPicToSee to getAt(gPicList, nextRanNum)
- deleteAt(gPicNumList, 1)
- go(nextPicToSee)
- end if
- end
-
- on setupPuppets start, end, switch
- repeat with x = start to end
- puppetSprite(x, switch)
- end repeat
- end
-
- on SpriteVisibility start, end, switch
- repeat with x = start to end
- set the visible of sprite x to switch
- end repeat
- end
-
- on ButtonHiLite
- set whichNumber to the castNum of sprite the clickOn
- if rollOver(the clickOn) = 1 then
- set the hilite of cast whichNumber to 1
- else
- set the hilite of cast whichNumber to 0
- end if
- end
-
- on SpriteHiLite oldCast, newCast
- if rollOver(the clickOn) = 1 then
- set newCastNum to the number of member newCast
- set the castNum of sprite the clickOn to newCastNum
- updateStage()
- else
- set oldCastNum to the number of member oldCast
- set the castNum of sprite the clickOn to oldCastNum
- updateStage()
- end if
- end
-
- on BlinkGus
- if random(20) = 5 then
- set newCast to the number of member "GusBlink"
- set oldCast to the castNum of sprite 16
- set the castNum of sprite 16 to newCast
- updateStage()
- miniDelay(0.20000000000000001)
- set the castNum of sprite 16 to oldCast
- updateStage()
- end if
- end
-
- on shutDownBowling
- set counter to 1
- repeat while counter < 49
- puppetSprite(counter, 0)
- set counter to counter + 1
- end repeat
- if gDemoState <> 1 then
- mouseLock(1)
- end if
- puppetSound(0)
- set the volume of sound 1 to 255
- set the volume of sound 2 to 255
- end
-
- on miniDelay Howlong
- set startTime to the ticks
- set DoneTime to the ticks + (Howlong * 60)
- set done to 0
- repeat while done = 0
- if the ticks > DoneTime then
- set done to 1
- end if
- end repeat
- end
-
- on SkipAhead goWhere
- if gCorpDemo = "Picker DemoAll" then
- set gCorpDemo to "Picker DemoNone"
- go("logo", gPickerPath)
- dontPassEvent()
- else
- dontPassEvent()
- sound stop 1
- updateStage()
- mouseLock(1)
- go(goWhere)
- end if
- end
-
- on doButtonHilite goWhere
- set myNormalButton to the castNum of sprite the clickOn
- set myHiliteButton to myNormalButton + 1
- set myButtonSprite to the clickOn
- set myMouseDownSound to "mapbutdn"
- set myMouseUpSound to "mapbutup"
- set the castNum of sprite myButtonSprite to myHiliteButton
- puppetSound(myMouseDownSound)
- updateStage()
- repeat while soundBusy(1) = 1
- nothing()
- end repeat
- puppetSound(0)
- if goWhere <> "WhistleUp" then
- repeat while the stillDown
- if rollOver(myButtonSprite) = 1 then
- set the castNum of sprite myButtonSprite to myHiliteButton
- else
- set the castNum of sprite myButtonSprite to myNormalButton
- end if
- updateStage()
- end repeat
- end if
- set the castNum of sprite myButtonSprite to myNormalButton
- puppetSound(0)
- updateStage()
- if goWhere = "WhistleUp" then
- mouseLock(1)
- go(goWhere)
- exit
- end if
- if rollOver(myButtonSprite) = 1 then
- updateStage()
- puppetSound(0)
- if goWhere = "leave2" then
- shutDownBowling()
- end if
- mouseLock(1)
- go(goWhere)
- exit
- end if
- repeat while soundBusy(1)
- nothing()
- end repeat
- puppetSound(0)
- updateStage()
- end
-
- on StopGusMusic
- sound fadeOut 2, 2 * 60
- puppetSprite(16, 0)
- mouseLock(0)
- go(marker(1))
- end
-
- on mouseLock LockState
- global gDemoState
- if gDemoState <> 1 then
- if LockState = 0 then
- set the mouseDownScript to EMPTY
- set the mouseUpScript to EMPTY
- else
- set the mouseDownScript to "DontPassEvent"
- set the mouseUpScript to "DontPassEvent"
- end if
- end if
- end
-
- on SkipTheOpening goWhere, killsound
- if gCorpDemo = "Picker DemoAll" then
- set gCorpDemo to "Picker DemoNone"
- go("logo", gPickerPath)
- dontPassEvent()
- else
- mouseLock(1)
- startTimer()
- if killsound = 1 then
- sound fadeOut 2, 30
- end if
- go(goWhere)
- end if
- end
-
- on SkipIntro
- sound stop 1
- updateStage()
- set gSkipIntro to 1
- SkipAhead("TurnBack")
- end
-
- on MacAudio howmanyFrames
- if the machineType <> 256 then
- go(the frame + howmanyFrames)
- end if
- end
-
- on initCloseAudio
- set CloseAudioList to ["MWS_110.aif", "MWS_111.AIF", "MWS_112.AIF"]
- set gCurrentSound to getAt(CloseAudioList, 1)
- puppetSound(gCurrentSound)
- end
-
- on closeAudioTest
- if soundBusy(1) = 0 then
- set whichSound to getOne(CloseAudioList, gCurrentSound)
- if whichSound < count(CloseAudioList) then
- set gCurrentSound to getAt(CloseAudioList, whichSound + 1)
- puppetSound(gCurrentSound)
- go(the frame)
- else
- exit
- end if
- else
- go(the frame)
- end if
- end
-
- on doCloseButtonHilite actionHandler
- if gDemoState = 1 then
- exitAutoRun()
- else
- set myNormalButton to the castNum of sprite the clickOn
- set myHiliteButton to myNormalButton + 1
- set myButtonSprite to the clickOn
- set the castNum of sprite myButtonSprite to myHiliteButton
- repeat while the stillDown
- if rollOver(myButtonSprite) = 1 then
- set the castNum of sprite myButtonSprite to myHiliteButton
- else
- set the castNum of sprite myButtonSprite to myNormalButton
- end if
- updateStage()
- end repeat
- set the castNum of sprite myButtonSprite to myNormalButton
- updateStage()
- end if
- end
-
- on rightMouseDown
- dontPassEvent()
- end
-
- on rightMouseUp
- dontPassEvent()
- end
-